<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@ include file="/web/header.jsp" %>
<title>添加界面</title>
</head>
<body>
<fieldset class="layui-elem-field" style="margin:30px;padding:30px">
	<legend>添加用户</legend>
	<div class="layui-field-box">
			<form class="layui-form-pane layui-form">
				<div class="layui-form-item">
					<label class="layui-form-label">账户</label>
					<div class="layui-input-inline">
						<input class="layui-input" name="code" type="text" placeholder="请输入账户"
						required lay-verify="required" autocomplete="off">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">姓名</label>
					<div class="layui-input-inline">
						<input class="layui-input" name="name" type="text" placeholder="请输入姓名"
						required lay-verify="required" autocomplete="off">
					</div>
				</div>
				
				<div class="layui-form-item">
					<div class="layui-input-inline">
						<input type="button" value="确定" class="layui-btn" lay-submit lay-filter="add"  />
						<input type="reset" value="重置" class="layui-btn layui-btn-primary" />
					</div>
				</div>
			</form>
		</div>
		
	</fieldset>
	
	<script type="text/javascript">
	
	formOn('submit(add)','/user/insert.do','text',function(data){	
		if(data=="1"){	
			layer.msg("添加成功",toClose);	
		}else{	
			layer.msg("添加失败");	
		}
	})
	</script>	
				
</body>
</html>